package com.hadoop.practice.ugi.login;

import org.apache.hadoop.security.IdealUGITool;
import org.apache.hadoop.security.UserGroupInformation;

/**
 * User: wujun
 * Date: 2014/8/18
 */
public class MainLogin {

    public static void main(String[] args) {

        String username = args[0];
        String password = args[1];
        UserGroupInformation ugi = IdealUGITool.getVerifiedUgiByPwd(username, password);
        System.out.println(String.format("user.name: %s", System.getProperty("user.name")));
        System.out.println(String.format("UGI user: %s", ugi.getUserName()));
    }
}
